package com.wc.fortnight_blue_bridge.Q231024.Q5887;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2023/10/24 19:05
 * @description 铺地板
 * https://www.lanqiao.cn/problems/5887/learning/?contest_id=145
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        while (n-->0){
            int width = sc.nextInt();
            int height = sc.nextInt();

            if (width>=2&&height>=2){
                if (width*height%6==0){
                    System.out.println("Yes");
                    continue;
                }
            }
            System.out.println("No");
        }
    }
}
